package com.example.buxiaorui.studentsystem;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

import java.io.File;

public class WelcomeActivity extends AppCompatActivity {
    private SharedPreferences sp;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.welcome_activity);
    }
    public void go(View view){
//        Intent intent=new Intent(this,MainActivity.class);
//        startActivity(intent);
//        finish();

        sp=getSharedPreferences("login_status",MODE_PRIVATE);
        String status=sp.getString("status","false");
        Log.i("TEST",status+"");
        if (status=="false"){
            Intent intent=new Intent(this,MainActivity.class);
            startActivity(intent);
            finish();
        }else {
            Intent intent=new Intent(this,StudentsListActivity.class);
            startActivity(intent);
            finish();

        }
    }



}
